package com.baoyouqun.domain.VO;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Objects;

@Data
public class UserVO implements Serializable {


    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "")
    private String id;

    @ApiModelProperty(value = "名字")
    private String name;

    @ApiModelProperty(value = "名字")
    private String headImg;

    @ApiModelProperty(value = "注册号码")
    private String cellphone;

    @ApiModelProperty(value = "联系号码")
    private List<String> extraPhones;

    @ApiModelProperty(value = "性别")
    private String sex;

    @ApiModelProperty(value = "公司名称")
    private String company;

    @ApiModelProperty(value = "职位")
    private String job;

    @ApiModelProperty(value = "教育程度")
    private String education;

    @ApiModelProperty(value = "行业")
    private String industry;

    @ApiModelProperty(value = "地区代码")
    private String cityCode;

    @ApiModelProperty(value = "省")
    private String province;

    @ApiModelProperty(value = "市")
    private String city;

    @ApiModelProperty(value = "区县")
    private String district;

    @ApiModelProperty(value = "是否启用 false为禁用")
    private Boolean disEnable;

    @ApiModelProperty(value = "是否启用")
    private String disEnableName;

    @ApiModelProperty(value = "是否注销 false为禁用")
    private Boolean logout;

    @ApiModelProperty(value = "豹子号标识")
    private Boolean baoZhiHao;

    @ApiModelProperty(value = "IM认证")
    private String imUserSig;

    @ApiModelProperty(value = "微信身份昵称")
    private String wxName;

    @ApiModelProperty(value = "微信身份")
    private String wxOpenid;

    @ApiModelProperty(value = "微信会话密钥session_key")
    private String wxSessionKey;

    @ApiModelProperty(value = "session_key过期时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime wxSessionExpire;

    @ApiModelProperty(value = "会员级别名称")
    private String memberLevelName;

    @ApiModelProperty(value = "会员级别")
    private String memberLevel;

    @ApiModelProperty(value = "是否公开拥有资源")
    private Boolean isPublicResource;
    @ApiModelProperty(value = "资源&需求列表")
    private List<UserResourceVO> resourceVOList;


    public String getDisEnableName() {
        if (Objects.nonNull(disEnable) && disEnable) {
            disEnableName = "已禁用";
        } else {
            disEnableName = "正常";
        }
        return disEnableName;
    }
}